package test.ground.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;  
import org.springframework.context.annotation.Configuration;  

@Configuration  
public class FilterConfig {  

    @Bean  
    public FilterRegistrationBean<WebTraceMonitorFilter> webTraceMonitorFilter() {  
        FilterRegistrationBean<WebTraceMonitorFilter> registrationBean = new FilterRegistrationBean<>();  
        
        registrationBean.setFilter(new WebTraceMonitorFilter());  
        registrationBean.addUrlPatterns("/*"); // 过滤所有 URL 请求  
        registrationBean.setOrder(-20000); // 设置过滤器的顺序
        return registrationBean;  
    }
}